<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="utf-8">
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Page title -->
    <title>Petz - Pet HTML5 Template</title>
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/foreground/js/respond.js"></script>
    <![endif]-->
    <!-- Bootstrap Core CSS -->
    <link href="${pageContext.request.contextPath}/foreground/css/bootstrap.css" rel="stylesheet" type="text/css">
    <!-- Icon fonts -->
    <link href="${pageContext.request.contextPath}/foreground/fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/foreground/fonts/flaticons/flaticon.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/foreground/fonts/glyphicons/bootstrap-glyphicons.css" rel="stylesheet" type="text/css">
    <!-- Google fonts -->
    <link href="https://fonts.googleapis.com/css?family=Lato:400,800" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Baloo+Thambi" rel="stylesheet">
    <!-- Style CSS -->
    <link href="${pageContext.request.contextPath}/foreground/css/style.css" rel="stylesheet">
    <!-- Plugins CSS -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/foreground/css/plugins.css">
    <!-- Color Style CSS -->
    <link href="${pageContext.request.contextPath}/foreground/styles/maincolors.css" rel="stylesheet">

    <script src="${pageContext.request.contextPath}/background/js/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/background/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/background/js/xadmin.js"></script>

</head>
<body>
<%--导航栏--%>
<%@ include file="../common/topbar.jsp" %>

<section id="contact" class="pages no-padding">
    <div class="jumbotron" data-stellar-background-ratio="0.5">
        <!-- Heading -->
        <div class="jumbo-heading" data-stellar-background-ratio="1.2">
            <h1>流浪求助</h1>
        </div>
    </div>
    <!-- container -->
    <div class="container">
        <div class="row">
            <div class="col-lg-5 col-md-5">
                <h3>我们的联系方式 </h3>
                <ul class="list-inline">
                    <li><i class="fa fa-envelope"></i><a href="mailto:2899599952@qq.com">邮箱：2899599952@qq.com</a></li>
                    <li><i class="fa fa-phone margin-icon"></i>电话：13514784678</li>
                    <li><i class="fa fa-map-marker margin-icon"></i>地址：包头师范学院</li>
                </ul>
                <p style="user-select: none;cursor: auto">
                    如您发现流浪的小动物，请及时与我们联系，您的善举将挽救一个小动物的生命，如果您不方便与我们联系，请在旁边的表格里填写提交具体信息，我们会展开救援活动
                </p>
                <img src="${pageContext.request.contextPath}/foreground/img/contactpage1.png" alt="" class="img-rounded center-block img-responsive">
            </div>

            <!-- Contact Form -->
            <div class="col-lg-6 col-md-6 col-lg-offset-1 col-md-offset-1 res-margin">
                <h3>具体信息</h3>
                <!-- Form Starts -->
                <div id="contact_form">
                    <form class="form-group" id="myform">
                        <label>用户名<span class="required">*</span></label>
                        <input type="text" value="${username}" class="form-control input-field" readonly=“readonly” required>
                        <label>发现动物时间<span class="required">*</span></label>
                        <input type="datetime-local" name="hTime" class="form-control input-field" required>
                        <label>发现动物地点<span class="required">*</span></label>
                        <input type="text" name="hLocation" class="form-control input-field" required>
                        <label>动物外貌特征描述<span class="required">*</span></label>
                        <textarea name="hFormation" id="message" class="textarea-field form-control" rows="5"
                                  required autocomplete="off" wrap="hard"></textarea>
                    </form>
                    <button type="button"  id="submit_btn" onclick="AddHelp()" value="Submit" class="btn center-block" form="myform">提交</button>
                </div>
                <div id="contact_results"></div>
            </div>
        </div>
    </div>
    <div class="container-fluid margin1">
    </div>
</section>
<script>

    /*用户-注册*/
    function AddHelp(){
        layer.confirm('确认要发送求助信息吗？',function() {
            //发异步删除数据
            $.ajax({
                url: "AddHelp",
                data: $('#myform').serialize(),//servlet按照"classobj_id"取值
                type: "POST",
                success: function (s) {//从servlet获取返回数据data:{SUCCESS ERREO}
                    if (s == "SUCCESS") {
                        layer.msg('已提交管理员审核，请耐心等待!!', {icon: 1, time: 1000});
                        window.location.reload();
                    } else {
                        layer.alert(s, {title: "提交失败"});
                    }
                }
            });
        });
    }
</script>
</body>
</html>
